//
//  DirectionView.m
//  Model
//
//  Created by zeb-apple on 2017/6/2.
//  Copyright © 2017年 YDJH. All rights reserved.
//  方向视图 上下左右

#import "DirectionView.h"

@interface DirectionView ()

@property (nonatomic, copy) ClickDirectionViewBlock  clickDirectionViewBlock;

@end

@implementation DirectionView

- (instancetype)initWithFrame:(CGRect)frame clickDirectionViewBlock:(ClickDirectionViewBlock)clickDirectionViewBlock {
    self = [super initWithFrame:frame];
    if (self) {
        self.clickDirectionViewBlock = clickDirectionViewBlock;
        self.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click)];
        [self addGestureRecognizer:tap];
    }
    return self;
}
- (void)click {
    self.clickDirectionViewBlock(self);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
